﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataLayer;
using System.Xml.Serialization;
using System.IO;

namespace DataEditor.BuisnessLayer
{
    public class DataManager
    {
        private string _outputFile;

        public DataManager(String pOutputDataFile)
        {
            Singleton.Init();
            _outputFile = pOutputDataFile;
        }
        public DataManager()
        {
            Singleton.Init();
            _outputFile = Singleton.SkillDataFileName;
        }
        public Occupations ReadData()
        {
            return Singleton.Classes;
        }

        public void SaveData(Occupations pData)
        {
            var serializer = new XmlSerializer(typeof(Occupations));
            using (var stream = new StreamWriter(_outputFile))
                serializer.Serialize(stream, pData);
        }


    }
}
